﻿import flash.external.*;
import v1.remote.*;
class v1.remote.FlashHttpRequestExternalInterfaceManager {
	var _httpRequest:FlashHttpRequest = null;
	
	function FlashHttpRequestExternalInterfaceManager() {
	}

	function flaReponseHandler(opt:Object) {

		try {
			_httpRequest.request( opt );				
		} catch (error : Error) {
			trace(error);
		}

	}	

	function externalInterface(httpRequest:FlashHttpRequest) {
		// defined inner http request 
		_httpRequest = httpRequest;
		// --- create the addCallback javascript ---
		if (ExternalInterface.available) {
			ExternalInterface.addCallback("sendAndLoad",flaReponseHandler);
		}

	}
}